

use "${pathdata_robustness}/RobustnessExperiment3.dta", clear
/*
Treatments
1. = 3 Product
2. = 1 Product
3. = 6 Product

*/



* ########## REGRESSIONS ##########

	* Treatment indicators
	gen oneproduct = 0
	replace oneproduct = 1 if treatment == 2

	gen sixproduct = 0
	replace sixproduct = 1 if treatment == 3


preserve
	/* Regression Belief Impact delay product */

	
	keep PROLIFIC_PID product effect effect_recall correct_recall oneproduct sixproduct storyshort

	rename effect dev0
	rename effect_recall dev1

	reshape long dev, i(PROLIFIC_PID product) j(delay) // Make the data long as we want to pool Immediate and Delay

	* Interaction Terms
	gen delayXoneproduct = 0
	replace delayXoneproduct = 1 if delay == 1 & oneproduct == 1

	gen delayXsixproduct = 0
	replace delayXsixproduct = 1 if delay == 1 & sixproduct == 1

	*Column (1): STORY TREATMENT ONLY - Belief Impact on indicators - LONG DATASET
	eststo reg1: reg dev delay oneproduct delayXoneproduct sixproduct delayXsixproduct if storyshort == 1, cluster(PROLIFIC_PID)
	estadd scalar x = _b[_cons] // Here, we store the constant to put it into the footer :) 

	*Column (2): NOSTORY TREATMENT ONLY - Belief Impact on indicators - LONG DATASET
	eststo reg2: reg dev delay oneproduct delayXoneproduct sixproduct delayXsixproduct if storyshort == 0, cluster(PROLIFIC_PID)
	estadd scalar x = _b[_cons]

restore




preserve

	/* Regression correct recall on number of product */

	*Column (3): STORY TREATMENT ONLY - Correct recall on product indicators
	eststo reg3: reg correct_recall oneproduct sixproduct if storyshort == 1, cluster(PROLIFIC_PID)
	estadd scalar x = _b[_cons]
	
	*Column (4): NOSTORY TREATMENT ONLY - Correct recall on product indicators
	eststo reg4: reg correct_recall oneproduct sixproduct if storyshort == 0, cluster(PROLIFIC_PID)
	estadd scalar x = _b[_cons]
	
	
	
	
restore
	
	
	esttab reg1 reg2 reg3 reg4 using "${pathout_robustness}/tables/tableA3.tex", ///
		booktabs nonotes replace compress label nomtitles star(* 0.10 ** 0.05 *** 0.01) ///
		keep(delay oneproduct delayXoneproduct sixproduct delayXsixproduct) order(oneproduct delayXoneproduct sixproduct delayXsixproduct delay) coeflabels(delay "Delay" oneproduct "1-Product" delayXoneproduct "Delay $/times$ 1-Product" sixproduct "6-Products" delayXsixproduct "Delay $/times$ 6-Products") ///
		se(2) b(a2) stats(x N r2, fmt(2 0 2) label("Control Mean" "Observations" "R^2"))  ///
		prehead("{\begin{tabular}{l*{4}{c}}\toprule\toprule&\multicolumn{4}{c}{\textit{Dependent variable:}}//[.1cm] &\multicolumn{2}{c}{Belief Impact} &  \multicolumn{2}{c}{Combined Recall} //\cmidrule(lr){2-3} \cmidrule(lr){4-5} // \textit{Sample:} &\multicolumn{1}{c}{Story} &\multicolumn{1}{c}{Stat} &\multicolumn{1}{c}{Story} &\multicolumn{1}{c}{Stat} //")
